#< { 'use-with':'Pacify' , 'type':'output' , 'name':'plaintext' , 'argvalue':'txt' , 'extension':'txt'  , 'version':'2011.1003' , 'author':'AGGOTT HÖNSCH István'} >#

from ptext import *

def load_module(self):
	self.addMethod(init_output)
	self.addMethod(writefile)

def init_output(self):
	return True

def writefile(self):
	self.log.info('Preparing to write ' + self.outfilename + '...')
	
	outfile = open(self.outfilename, 'wb')
	outfile.write(bytes(str(self.buffer), 'UTF-8'))
	outfile.close()
	
	self.log.info('Successfully wrote ' + self.outfilename + '.')
	
	return True

if __name__ == "__main__":
	print("\n\tThis is a Pacify plugin and cannot be executed directly.")